﻿@using Known.AntBlazor
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Routing
@inject UIService AntUI

<CascadingAuthenticationState>
    <CascadingValue Value="context">
        <Router AppAssembly="typeof(App).Assembly">
            <Found Context="routeData">
                <AuthorizeRouteView RouteData="@routeData">
                    <Authorizing></Authorizing>
                </AuthorizeRouteView>
            </Found>
            <NotFound>
                <Result Status="404" />
            </NotFound>
        </Router>
        <AntContainer />
    </CascadingValue>
</CascadingAuthenticationState>

@code {
    private Context context;

    protected override void OnInitialized()
    {
        context = new Context(AntUI);
        base.OnInitialized();
    }
}